{extend name="base/index"/}
{block name="page_location"}{/block}
{block name="body"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>商品发布</li>
				</ol>
			</div>
			<h4 class="page-title">
            	{eq name="act" value="edit"}
            	产品修改
            	{else/}
            	发布新产品
            	{/eq}
			</h4>
		</div>
	</div>
</div>
<div class="row" id="goods_publish_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<form action="#" class="form-horizontal" id="goods_edit_frm">
	            	<input type="hidden" name="id" value="{$goods_id}" />
	            	<input type="hidden" name="cid" value="{$cid}" />
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品所属分类:</label>
						<div class="col-5">
							<select class="form-control ipt_check" tabindex="1" name="classid" data-type="select" data-len="1-100000000" nullmsg="请选择产品所属分类">
								<option value="0">--请选择产品所属分类--</option>
								{$cats_tree}
							</select>
							<span class="font-13 text-muted">请选择产品分类</span>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品编号:</label>
						<div class="col-5">
							<input name="gid" value="" type="text" placeholder="" class="form-control ipt_check" data-type="string" data-len="2-150" nullmsg="产品编号不能为空" errormsg="产品编号长度为2-150" />
							<span class="font-13 text-muted">输入产品编号</span>
						</div>
					</div>					
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品标题:</label>
						<div class="col-5">
							<input name="goodsname" value="" type="text" placeholder="" class="form-control ipt_check" data-type="string" data-len="2-150" nullmsg="产品标题不能为空" errormsg="产品标题长度为2-150"/>
							<span class="font-13 text-muted">输入产品标题</span>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">标志:</label>
						<div class="col-5">
							{volist name="flag_list" id="flag"}
								<div class="custom-control custom-checkbox">
									<input type="checkbox" class="custom-control-input check_id" id="check_id{$key}" value="{$flag.flag}" name="flag[]">
									<label class="custom-control-label" for="check_id{$key}">{$flag.flagname}</label>
								</div>
							{/volist}
							<span class="font-13 text-muted"></span>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品关键字:</label>
						<div class="col-8">
							<textarea name="keyword" class="form-control" rows="5" style="width:50%;height:100px;"></textarea>
							<span class="font-13 text-muted">输入产品关键字</span>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品简介:</label>
						<div class="col-8">
							<textarea name="description" class="form-control" rows="5" style="width:50%;height:100px;"></textarea>
							<span class="font-13 text-muted">输入产品简介</span>
						</div>
					</div>					
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品价格:</label>
						<div class="col-5">
							 <span class="mutl-label">市场价：</span>
							 <input type="text" value="" placeholder="市场价格" class="form-control ipt_check" data-type="float" data-len="10-2" nullmsg="产品市场价格不能为空" errormsg="产品市场价格格式错误" name="marketprice"/>
							<span class="mutl-label">销售价：</span>
							<input type="text" value="" placeholder="销售价格" class="form-control ipt_check" data-type="float" data-len="10-2" nullmsg="销售价格不能为空" errormsg="销售价格格式错误" name="salesprice"/>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">快递运费:</label>
						<div class="col-8">
							<div class="custom-control custom-radio" style="float: left;">
								<input type="radio" name="payfreight" id="payfreight1" class="custom-control-input" value="0" checked="checked">
								<label class="custom-control-label" for="payfreight1">客户</label>
							</div>
							<div class="custom-control custom-radio" style="float: left;margin-right: 20px;">
								<input type="radio" name="payfreight" id="payfreight2" class="custom-control-input" value="1">
								<label class="custom-control-label" for="payfreight2">商家</label>
							</div>
							<input type="text" value="" placeholder="输入需要支付的运费" class="form-control" name="freight" style="width: 200px;float: left;"/>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品库存:</label>
						<div class="col-5">
							 <input type="text" value="" placeholder="请输入产品库存" class="form-control ipt_check" data-type="float" data-len="10-2" nullmsg="产品库存不能为空" errormsg="产品库存格式错误" name="housenum"/>
							 {eq name="act" value="edit"}
							<a href="javascript:;" class="btn red salesvolume"></a>
							{/eq}
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品重量 :</label>
						<div class="col-5">
							 <input type="text" value="" placeholder="请输入产品重量" class="form-control ipt_check" data-type="float" data-len="10-2" nullmsg="产品重量不能为空" errormsg="产品重量格式错误" name="weight"/>
							 <span class="font-13 text-muted">单位:kg</span>
						</div>
					</div>						
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">可得积分:</label>
						<div class="col-5">
							 <input type="text" value="" placeholder="请输入可得积分" class="form-control ipt_check" data-type="float" data-len="10-2" nullmsg="可得积分不能为空" errormsg="可得积分格式错误" name="integral"/>
						</div>
					</div>					
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">商品主图：</label>
						<div class="col-5">
							<div class="config_uploadfile picurl ipt_check" data-type="upload" attr-inputname="picurl" nullmsg="商品主图没有上传" attr-value="" isCompress="1"></div>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">商品图组：</label>
						<div class="col-5">
							<div class="config_uploadfile picarr" attr-value="" attr-inputname="picarr" isCompress="1"></div>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">商品详细内容：</label>
						<div class="col-9">
							<textarea id="content" name="content"></textarea>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品排序:</label>
						<div class="col-5">
							 <input type="text" value="{$orderid}" placeholder="请输入排序号" class="form-control"  name="orderid"/>
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">产品状态:</label>
						<div class="col-5">
							<div class="custom-control custom-radio">
								<input type="radio" name="status" id="status1" class="custom-control-input" value="0" checked="checked">
								<label class="custom-control-label" for="status1">上架</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="status" id="status2" class="custom-control-input" value="1">
								<label class="custom-control-label" for="status2">下架</label>
							</div> 							
						</div>
					</div>
					<div class="form-group row mb-1">
						<label class="col-3 col-form-label">更新时间:</label>
						<div class="col-5">
							<input type="text" name="posttime" class="form-control" value="{$posttime}">
						</div>
					</div>
				</form>
			</div>
			<div class="card-footer text-muted">
				<div class="form-group row mb-1">
					<label class="col-2 col-form-label"></label>
					<div class="col-5">
						<button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#goods_edit_frm" attr-callback="back" attr-model="goods"
					 attr-active="save_goods">立即提交</button>
					</div>
				</div>	
			</div>			
		</div>
	</div>
</div>

{/block}
{block name="script"}
<script src="__PLUGIN__/ueditor/ueditor.config.js" type="text/javascript" ></script>
<script src="__PLUGIN__/ueditor/ueditor.all.min.js" type="text/javascript" ></script>
<script type="text/javascript" src="__PLUGIN__/jQuery.cxCalendar/js/jquery.cxcalendar.min.js"></script>
<script type="text/javascript" src="__PLUGIN__/jQuery.cxCalendar/js/jquery.cxcalendar.languages.js"></script>
<link rel="stylesheet" href="__PLUGIN__/jQuery.cxCalendar/css/jquery.cxcalendar.css" />
<script type="text/javascript">
	$(function(){
		File_Upload('.picurl','image','picurl',false);
		File_Upload('.picarr','image','picarr',true);
		UE.getEditor(
			'content', 
			{
			serverUrl: '/static/plugin/ueditor/php/controller.php',
			toolbars:Get_UEditor_Config('full')
		 	}
		);
		$("input[name=posttime]").cxCalendar({
			type: 'datetime',
			format: 'YYYY-MM-DD HH:mm:ss'
		});
	});
</script>
{/block}